package jehc.djshi.log.service.impl;

import jehc.djshi.common.util.ExceptionUtil;
import jehc.djshi.log.dao.XtOperateLogsDao;
import jehc.djshi.log.model.XtOperateLogs;
import jehc.djshi.log.service.XtOperateLogsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

/**
 * @Desc 操作日志
 * @Author 邓纯杰
 * @CreateTime 2012-12-12 12:12:12
 */
@Service
public class XtOperateLogsServiceImpl implements XtOperateLogsService {
	@Autowired
	private XtOperateLogsDao xtOperateLogsDao;
	/**
	* 分页
	* @param condition 
	* @return
	*/
	public List<XtOperateLogs> getXtOperateLogsListByCondition(Map<String,Object> condition){
		try {
			return xtOperateLogsDao.getXtOperateLogsListByCondition(condition);
		} catch (Exception e) {
			throw new ExceptionUtil(e.getMessage(),e.getCause());
		}
	}
	/**
	* 查询对象
	* @param xt_operate_log_id 
	* @return
	*/
	public XtOperateLogs getXtOperateLogsById(String xt_operate_log_id){
		try {
			return xtOperateLogsDao.getXtOperateLogsById(xt_operate_log_id);
		} catch (Exception e) {
			throw new ExceptionUtil(e.getMessage(),e.getCause());
		}
	}
	/**
	* 添加
	* @param xtOperateLogs
	* @return
	*/
	public int addXtOperateLogs(XtOperateLogs xtOperateLogs){
		int i = 0;
		try {
			i = xtOperateLogsDao.addXtOperateLogs(xtOperateLogs);
		} catch (Exception e) {
			throw new ExceptionUtil(e.getMessage(),e.getCause());
		}
		return i;
	}
	/**
	* 修改
	* @param xtOperateLogs
	* @return
	*/
	public int updateXtOperateLogs(XtOperateLogs xtOperateLogs){
		int i = 0;
		try {
			i = xtOperateLogsDao.updateXtOperateLogs(xtOperateLogs);
		} catch (Exception e) {
			throw new ExceptionUtil(e.getMessage(),e.getCause());
		}
		return i;
	}
	/**
	* 删除
	* @param condition 
	* @return
	*/
	public int delXtOperateLogs(Map<String,Object> condition){
		int i = 0;
		try {
			i = xtOperateLogsDao.delXtOperateLogs(condition);
		} catch (Exception e) {
			throw new ExceptionUtil(e.getMessage(),e.getCause());
		}
		return i;
	}
}
